<?php

namespace App\Http\Resources;


use Illuminate\Http\Resources\Json\ResourceCollection;

class DeptCollection extends ResourceCollection
{
    public function toArray($request)
    {
        return $this->collection->transform(function ($item) {
            return [
                'id' => $item->id,
                'parentId' => $item->parent_id,
                'name' => $item->name,
                'value' => $item->value,
                'sort' => $item->sort,
                'createTime' => $item->create_time ,
                'updateTime' => $item->update_time
            ];
        });
    }
}

